/*
* Copyright (C) 2013 Nivis LLC.
* Email:   opensource@nivis.com
* Website: http://www.nivis.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
* 
* Redistribution and use in source and binary forms must retain this
* copyright notice.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef MEMORYFACTORYDAL_H_
#define MEMORYFACTORYDAL_H_

#include "../IFactoryDal.h"
#include "MemoryCommandsDal.h"
#include "MemoryDevicesDal.h"

namespace hart7 {
namespace hostapp {

class MemoryFactoryDal : public IFactoryDal
{
public:
	MemoryFactoryDal() : commandsDal(), devicesDal()
	{
	}
	virtual ~MemoryFactoryDal()
	{		
	}

//transaction
private:
	void BeginTransaction()
	{		
	}
	void CommitTransaction()
	{		
	}
	void RollbackTransaction()
	{		
	}

//entities
private:
	ICommandsDal& Commands() const
	{
		MemoryFactoryDal* pThis = const_cast<MemoryFactoryDal*>(this);
		return pThis->commandsDal;
	}
	IDevicesDal& Devices() const
	{
		MemoryFactoryDal* pThis = const_cast<MemoryFactoryDal*>(this);
		return pThis->devicesDal;
	}

//database
private:
	void VacuumDatabase()
	{		
	}
	void CleanupOldRecords(nlib::DateTime olderThanDate, int maxCount)
	{		
	}

//
private:
	MemoryCommandsDal commandsDal;
	MemoryDevicesDal	devicesDal;
};

}
}
#endif /*MEMORYFACTORYDAL_H_*/
